#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>

using namespace std;

const int N = 108;
typedef long long LL;


struct Data {
	int x, y, id;
}a[N];

bool cmp(Data a, Data b)
{
	if (a.x == b.x) return a.y < b.y;
	else return a.x < b.x;
}

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int n;
	cin >> n;
	for (int i = 1; i <= n; i++)
	{
		cin >> a[i].x >> a[i].y;
		a[i].id = i;
	}
	cout << n / 2 << endl;
	sort(a + 1, a + n, cmp); //把 a 重新排序 距离·最近的两个点形成线段 相交几率最小
	for (int i = 1; i <= n; i += 2)
	{
		if (i + 1 <= n) cout << a[i].id << a[i + 1].id << endl;
	}


	return 0;
}

